package com.shiro.service;



import java.util.Date;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Service;

@Service
public class AnnoService {
    @RequiresRoles(value={"admin"})
         public void testAnno(){
    	     Subject subject = SecurityUtils.getSubject();
    	     Session session = subject.getSession();
        	 System.out.println(session.getAttribute("username") +""+ new Date());
         }
}
